<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    console.log(
        location.href,
        location.host,
        location.port,
        location.pathname,
        location.search,
        location.hash
    )
    location.assign('https://www.baidu.com') // 跟给href赋值一样，有历史记录 
    location.replace('https://www.baidu.com') // 替换当前页面，无历史记录 
    location.reload() // f5刷新 
    location.reload(true) // ctrl + f5 强制刷新 
</script>
</html>